package hardware;

import java.util.Hashtable;
import java.util.ArrayList;
import exceptions.compatibiltyProblem;

public class MotherBoard implements MotherboardInterface{
	int maxMem;
	int maxComps;
	int maxCPUs;
    public int getMaxCPUs() {
		return maxCPUs;
	}

	public void setMaxCPUs(int maxCPUs) {
		this.maxCPUs = maxCPUs;
	}

	Hashtable<String, Hardware> comps;
   
    public int getMaxMem() {
		return maxMem;
	}

	public void setMaxMem(int maxMem) {
		this.maxMem = maxMem;
	}

	public int getMaxComps() {
		return maxComps;
	}

	public void setMaxComps(int maxComps) {
		this.maxComps = maxComps;
	}

	@Override
	public Hardware getComp(String name) {
		 Hardware found =  comps.get(name);
		 return found;
	}

	@Override
	public String[] getCompList() {
		// TODO return a string array of components
		return null;
	}

	@Override
	public void install(Hardware deviceName) throws compatibiltyProblem {
		//TODO check that the comp list does not contain the max number of components 
		comps.put(deviceName.getName(), deviceName);
	}

	@Override
	public void remove(Hardware deviceName) {
		comps.remove(deviceName);
	}

}
